﻿// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "CollectableItem.generated.h"


UENUM(BlueprintType)
enum class ECollectableType : uint8
{
	// 金币
	Diamond,
	// 药瓶
	HealthPotion,
	// 升级二段跳
	DoubleJumpUpgrade
};

UCLASS()
class PLATFORMJUMP_API ACollectableItem : public AActor
{
	GENERATED_BODY()

	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, meta=(AllowPrivateAccess=true))
	class UCapsuleComponent* CapsuleComponent;

	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, meta=(AllowPrivateAccess=true))
	class UPaperFlipbookComponent* ItemFlipBook;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, meta=(AllowPrivateAccess=true))
	ECollectableType ItemType;

	UPROPERTY(EditAnywhere, Blueprintable, meta=(AllowPrivateAccess=true))
	float FloatingSpeed = 10.0f;

public:
	ACollectableItem();

	virtual void BeginPlay() override;

	virtual void Tick(float DeltaSeconds) override;

	UFUNCTION()
	void OverlapBegin(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult & SweepResult);
};
